import createAxios from '/@/utils/axios'
import {useAdminInfo} from '/@/stores/adminInfo'
/*
 * 公共请求函数和Url定义
 */
export const clearCacheUrl = '/admin/ajax/clearCache'
export const refreshTokenUrl = '/api/common/refreshToken'
/**
 * 缓存清理接口
 */
export function postClearCache(type: string) {
    return createAxios(
        {
            url: clearCacheUrl,
            method: 'POST',
            data: {
                type: type,
            },
        }
    )
}
export function refreshToken() {
    const adminInfo = useAdminInfo()
    return createAxios({
        url: refreshTokenUrl,
        method: 'POST',
        data: {
            refreshToken: adminInfo.getToken('refresh')
        },
    })
}

